package com.lvs.zmwz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lvs.zmwz.entity.OrderList;
import com.lvs.zmwz.entity.Pinglun;
import com.lvs.zmwz.mapper.OrderListMapper;
import com.lvs.zmwz.service.IOrderListService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lvs.zmwz.util.QPage;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2022-07-21
 */
@Service
public class OrderListServiceImpl extends ServiceImpl<OrderListMapper, OrderList> implements IOrderListService {

    /**
     * 订单列表
     * @param qPage
     * @param sysManagerSearch
     * @return
     */
    @Override
    public IPage<OrderList> getListAll(QPage qPage, OrderList sysManagerSearch) {
        QueryWrapper<OrderList> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().like(StringUtils.isNotEmpty(sysManagerSearch.getOrderId()),OrderList::getOrderId,sysManagerSearch.getOrderId());
        queryWrapper.lambda().like(StringUtils.isNotEmpty(sysManagerSearch.getShopName()),OrderList::getShopName,sysManagerSearch.getShopName());
        queryWrapper.orderByDesc("ctime");
        IPage<OrderList> hjManagerIPage=this.page(new Page<>(qPage.getOffset(), qPage.getLimit()),queryWrapper);
        return hjManagerIPage;
    }
}
